import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/index.vue'
import Config from '../views/config/index.vue'
import Document from '../views/document/index.vue'

Vue.use(VueRouter)

const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return routerPush.call(this, location).catch(error => error)
}

const routes = [
    {
        path: "/",
        redirect: "/home"
    },
    {
        path: "/home",
        component: Home
    },
    {
        path: "/document",
        component: Document
    },
    {
        path: "/config",
        component: Config
    },

]

const router = new VueRouter({
    routes
})

export default router